<div class="navbar-header">
	<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
		<span class="sr-only">Toggle navigation</span>
		<span class="icon-bar"></span>
		<span class="icon-bar"></span>
		<span class="icon-bar"></span>
	</button>
</div>
<div class="mainmenu pull-left">
	<ul class="nav navbar-nav collapse navbar-collapse">
		<li><a href="/default" class="active">Trang chủ</a></li>
        <li><a href="/default/intro" class="active">Giới thiệu</a></li>
        <li class="dropdown"><a href="#">Tin tức<i class="fa fa-angle-down"></i></a>
            <ul role="menu" class="sub-menu">
                <?php
                    $modelNewsCat=new Default_Model_Newscat();                                        
                    $modelNewsItem=new Default_Model_Newsitem();
                    $newsCatList=$modelNewsCat->getAllData();
                    foreach($newsCatList as $newsCat){
                        $newsItemList[]=$modelNewsItem->getDataByCatId($newsCat['catId']);    
                    }                                    
                    $i=0;
                    foreach($newsCatList as $newsCat){
                        $i++;
                        ?>
                        <li>
                            <a href=''><?=$newsCat[catName]?></a>
                            <?php 
                                if(count($newsItemList[$i-1])){
                            ?>
                                    <span class="glyphicon glyphicon-chevron-right pull-right" style="color: white;"></span>
                                    <ul role="menu" class="sub-sub-menu">
                                    <?php 
                                        foreach($newsItemList[$i-1] as $newsItem){
                                            echo "<li><a href='#'>$newsItem[itemName]</a></li>";    
                                        }
                                    ?>                                                                                                                                               
                                    </ul>
                            <?php    
                                }                                                                                        
                            ?>                            
                        </li>
                        <?php                        
                    }                                        
                ?>                                										 
            </ul>
        </li>
        <li class="dropdown"><a href="#">Sản phẩm<i class="fa fa-angle-down"></i></a>
            <ul role="menu" class="sub-menu">
                <?php
                    $modelProductCat=new Default_Model_Productcat();                                        
                    $modelProductItem=new Default_Model_Productitem();
                    $productCatList=$modelProductCat->getDataDisplay();
                    foreach($productCatList as $productCat){
                        $productItemList[]=$modelProductItem->getDataByCatId($productCat['catId']);    
                    }                                    
                    $i=0;
                    foreach($productCatList as $productCat){
                        $i++;
                        ?>
                        <li>
                            <a href=''><?=$productCat['catName']?></a>
                            <?php 
                                if(count($productItemList[$i-1])){
                            ?>
                                    <span class="glyphicon glyphicon-chevron-right pull-right" style="color: white;"></span>
                                    <ul role="menu" class="sub-sub-menu">
                                    <?php 
                                        foreach($productItemList[$i-1] as $productItem){
                                            echo "<li><a href='#'>$productItem[itemName]</a></li>";    
                                        }
                                    ?>                                                                                                                                               
                                    </ul>
                            <?php    
                                }                                                                                        
                            ?>                            
                        </li>
                        <?php                        
                    }                                        
                ?>                                										 
            </ul>
        </li>								 								
		<li><a href="/contact">Contact</a></li>
	</ul>
</div>